import _fetch from './request'

function getUserInfo () {
  return _fetch({
    url: 'v1_0/user',
    needToken: true
  })
}

function userProfile (id) {
  return _fetch({
    url: 'v1_0/user/profile',
    needToken: true,
    data: {
      target: id
    }
  })
}

function save (data) {
  return _fetch({
    url: 'v1_0/user/profile',
    method: 'PATCH',
    needToken: true,
    data
  })
}

export { getUserInfo, userProfile, save }
